

import { createRequest } from '@/request'

// 学生端
export const studentSseUserMessage = (data) => {
	return createRequest({
		url: `/student/sse/user/message`,
		method: 'get',
		params: data
	})
}
// 教师端
export const teacherSseUserMessage = (data) => {
	return createRequest({
		url: `/teacher/sse/user/message`,
		method: 'get',
		params: data
	})
}





//学生端-消息列表（分页）
export const getStudentMessageList = (data) => {
	return createRequest({
		url: `/student/user-message/page`,
		method: 'get',
		params: data,
	})
}

//学生端-获取消息详情
export const getStudentMessageDetail = (id) => {
	return createRequest({
		url: `/student/user-message/detail/${id}`,
		method: 'get',
	})
}
//学生端-标记消息为已读
export const markStudentMessageAsRead = (id) => {
	return createRequest({
		url: `/student/user-message/read/${id}`,
		method: 'post',
	})
}
//学生端-删除消息
export const deleteStudentMessage = (id) => {
	return createRequest({
		url: `/student/user-message/delete/${id}`,
		method: 'delete',
	})
}
//学生端-获取未读消息数量
export const getStudentUnreadMsgTotalNum = () => {
	return createRequest({
		url: `/student/user-message/unread/count`,
		method: 'get',
	})
}
//学生端-按消息分类获取未读消息数量
export const getStudentUnreadMessageNum = () => {
	return createRequest({
		url: `/student/user-message/unreadByCategory`,
		method: 'get',
	})
}


//教师端-消息列表（分页）
export const getTeacherMessageList = (data) => {
	return createRequest({
		url: `/teacher/user-message/page`,
		method: 'get',
		params: data,
	})
}
//教师端-获取消息详情
export const getTeacherMessageDetail = (id) => {
	return createRequest({
		url: `/teacher/user-message/detail/${id}`,
		method: 'get',
	})
}
//教师端-标记消息为已读
export const markTeacherMessageAsRead = (id) => {
	return createRequest({
		url: `/teacher/user-message/read/${id}`,
		method: 'post',
	})
}
//教师端-删除消息
export const deleteTeacherMessage = (id) => {
	return createRequest({
		url: `/teacher/user-message/delete/${id}`,
		method: 'delete',
	})
}
//教师端-获取未读消息数量
export const getTeacherUnreadMsgTotalNum = () => {
	return createRequest({
		url: `/teacher/user-message/unread/count`,
		method: 'get',
	})
}
//教师端-按消息分类获取未读消息数量
export const getTeacherUnreadMessageNum = () => {
	return createRequest({
		url: `/teacher/user-message/unreadByCategory`,
		method: 'get',
	})
}
